package com.hctforgreen.greenservice.model;

import android.util.Log;

import java.io.Serializable;

public class LocationEntity implements Serializable{
	private String mBaseLocation;// 网络定位基站
	private String mWifiLocation;// 网络定位wifi
	private String mGpsLocation;// gps定位
	private String province, city, district,street;//用于下拉框适配器
	private String province_loc, city_loc, district_loc;//记录定位信息
	private double mLongitude, mLatitude;//经纬度
	private String locationType;
	private String locationTime;

	public LocationEntity(){
	}
	
	public LocationEntity(double mLongitude,double mLatitude,String mBaseLocation,String mWifiLocation,String mGpsLocation,String province,String city,String district,String street,String province_loc,String city_loc,String district_loc,String locationType,String locationTime){
		this.mBaseLocation = (mBaseLocation!=null && mBaseLocation.length()>50)?mBaseLocation.substring(0, 49):mBaseLocation;//限制50个字
		this.mWifiLocation = (mWifiLocation!=null && mWifiLocation.length()>50)?mWifiLocation.substring(0, 49):mWifiLocation;//限制50个字
		this.mGpsLocation = (mGpsLocation!=null && mGpsLocation.length()>50)?mGpsLocation.substring(0, 49):mGpsLocation;//限制50个字
		this.province=province;
		this.city = city==null?province:city;//如果定位返回的城市为空，则将省传入（直辖市）
		this.district=district;
		this.street = street;
		this.province_loc=province_loc;
		this.city_loc=city_loc==null?province_loc:city_loc;//如果定位返回的城市为空，则将省传入（直辖市）
		this.district_loc=district_loc;
		this.mLongitude=mLongitude;
		this.mLatitude=mLatitude;
		this.locationType=locationType;
		this.locationTime=locationTime;
	}
	
	/**
	 * 是否定位成功
	 * @return
	 */
	public boolean isLocation(){
		if (mGpsLocation == null && mWifiLocation == null
				&& mBaseLocation == null) {
			return false;
		}else{
			return true;
		}
		
	}
	/**
	 * 是否填写地址
	 * @return
	 */
	public boolean isTextLocation() {
		if (province == null || city == null || district == null
				/*|| province.equals("") || city.equals("")
				|| district.equals("") */|| province.equals("=请选择=")
				|| city.equals("=请选择=") || district.equals("=请选择=")) {
			Log.d("填写地址", province+city+district);
			return false;
		} else {
			Log.d("填写地址", province+city+district);
			return true;
		}
	}
	
	public String getStreet() {
		return street;
	}
	public void setStreet(String street) {
		this.street = street;
	}
	public String getmBaseLocation() {
		return mBaseLocation;
	}
	public void setmBaseLocation(String mBaseLocation) {
		this.mBaseLocation = mBaseLocation;
	}
	public String getmWifiLocation() {
		return mWifiLocation;
	}
	public void setmWifiLocation(String mWifiLocation) {
		this.mWifiLocation = mWifiLocation;
	}
	public String getmGpsLocation() {
		return mGpsLocation;
	}
	public void setmGpsLocation(String mGpsLocation) {
		this.mGpsLocation = mGpsLocation;
	}
	public String getProvince() {
		return province;
	}
	public void setProvince(String province) {
		this.province = province;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getDistrict() {
		return district;
	}
	public void setDistrict(String district) {
		this.district = district;
	}
	public String getProvince_loc() {
		return province_loc;
	}
	public void setProvince_loc(String province_loc) {
		this.province_loc = province_loc;
	}
	public String getCity_loc() {
		return city_loc;
	}
	public void setCity_loc(String city_loc) {
		this.city_loc = city_loc;
	}
	public String getDistrict_loc() {
		return district_loc;
	}
	public void setDistrict_loc(String district_loc) {
		this.district_loc = district_loc;
	}
	public double getmLongitude() {
		return mLongitude;
	}
	public void setmLongitude(double mLongitude) {
		this.mLongitude = mLongitude;
	}
	public double getmLatitude() {
		return mLatitude;
	}
	public void setmLatitude(double mLatitude) {
		this.mLatitude = mLatitude;
	}
	public String getLocationType() {
		return locationType;
	}
	public void setLocationType(String locationType) {
		this.locationType = locationType;
	}
	public String getLocationTime() {
		return locationTime;
	}
	public void setLocationTime(String locationTime) {
		this.locationTime = locationTime;
	}
}
